<template>
  <van-card
    :title="item.name"
    :desc="item.artists[0].name"
    :thumb="item.artists[0].img1v1Url"
    num="2"
    price="2.00"
  >
    <template #footer>
      <van-button @click="onPlay(item.id)" type="primary" round size="small">播放</van-button>
    </template>
  </van-card>
</template>

<script setup>
defineProps({
  item: {
    type: Object,
    required: true
  }
})

const emit = defineEmits(["onPlay"])
const onPlay = (id) => {
  emit("onPlay", id)
}

</script>

<!--
<script>
export default {
  name: "MusicItem",
  props: {
    item: Object,
  }
}
</script>-->
